﻿/*
 *https://blog.csdn.net/linxinfa/article/details/51801319
 * https://docs.unity3d.com/ScriptReference/AssetPostprocessor.html
 */
#if UNITY_EDITOR
using System.IO;
using UnityEditor;
/// <summary>
/// 资源导入XLSX表监听
/// </summary>
public class ESF_XLSX_Editor_AssetPostprocessor : AssetPostprocessor
{
    /// <summary>
    /// xlsx文件后缀
    /// </summary>
    static ESF_FileExtAttribute mXlsxExt = enESF_UnityFileExt.Xlsx.ESF_FirstAttribute<ESF_FileExtAttribute>();
    
    //static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    //{
    //    if (importedAssets != null)
    //    {
    //        foreach (string file in importedAssets)
    //        {
    //            string ext = Path.GetExtension(file);
    //            if (mXlsxExt.IsExt(ext))
    //            {
    //                ESF_CollectAsset_XLSX xlsx = new ESF_CollectAsset_XLSX(file);
    //                xlsx.Resolve();
    //                ESF_Logic.BuildXlsxDbMaster(xlsx, (t, f, p) =>
    //                {
    //                    EditorUtility.DisplayProgressBar(t, f, p);
    //                });
    //            }
    //        }
    //        EditorUtility.ClearProgressBar();
    //    }
    //}
}
#endif
